{{ template "header" . }}
<div class="tap-target-wrapper">
    <div id="desc_4433" style="border-radius: 10%;" class="tap-target" data-target="tap-target-btn">
        <div class="tap-target-content">
            <h4>4433法则</h4>
            由台大财务金融学系邱显比教授提出的选基法则:</br>
            4:最近1年收益率排名在同类型基金前1/4</br>
            4:最近2年、3年、5年及今年来收益率排名均在同类型基金前1/4</br>
            3:最近6个月收益率排名在同类型基金前1/3</br>
            3:最近3个月收益率排名在同类型基金前1/3
        </div>
    </div>
</div>
<div id="index_content" class="row">
    <div class="col s12">
        <ul class="tabs">
            <li class="tab"><a href="#4433">4433基金</a></li>
            <li class="tab"><a href="#fundfilter">基金严选</a></li>
            <li class="tab"><a href="#fundcheck">基金检测</a></li>
            <li class="tab"><a href="#fundsim">持仓相似度</a></li>
            <li class="tab"><a href="#querybystock">股票选基</a></li>
        </ul>
    </div>

    <div id="4433" class="col s12">
        <h4 class="center"><span onclick="$('#desc_4433').tapTarget('open')">4433<i class="tiny material-icons">help_outline</i></span>基金列表</h4>
        <p class="tiny center">以下所有数据与信息仅供参考，不构成投资建议</p>
        <div class="divider"></div>
        <div class="left">
            更新时间:{{ .UpdatedAt }}</br>
            4433总数:{{ .Fund4433Count }}/筛选总数:{{ .AllFundCount }}
        </div>
        {{ template "fundtable" . }}
    </div>

    <!--filter start-->
    <div id="fundfilter" class="col s12">
        <div class="row">
            <form class="col s12" id="fundfilter_form" action="/fund/filter" method="GET">
                <div class="row">
                    <div class="input-field col s12 m12 l6">
                        <input id="year_1_rank_ratio" name="year_1_rank_ratio" value="25.00" type="number" step="any" class="validate">
                        <label for="year_1_rank_ratio">近1年绩效排名前百分之:</label>
                    </div>
                    <div class="input-field col s12 m12 l6">
                        <input id="this_year_235_rank_ratio" name="this_year_235_rank_ratio" type="number" class="validate" value="25.00" step="any">
                        <label for="this_year_235_rank_ratio">近2,3,5年及今年来绩效排名前百分之:</label>
                    </div>
                </div>
                <div class="row">
                    <div class="input-field col s12 m12 l6">
                        <input id="month_6_rank_ratio" name="month_6_rank_ratio" type="number" class="validate" value="33.33" step="any">
                        <label for="month_6_rank_ratio">近6个月绩效排名前百分之:</label>
                    </div>
                    <div class="input-field col s12 m12 l6">
                        <input id="month_3_rank_ratio" name="month_3_rank_ratio" type="number" class="validate" value="33.33" step="any">
                        <label for="month_3_rank_ratio">近3个月绩效排名前百分之:</label>
                    </div>
                </div>
                <div class="row">
                    <div class="input-field col s12 m12 l6">
                        <input id="min_scale" name="min_scale" type="number" class="validate" value="2" step="1">
                        <label for="min_scale">基金规模最小值（亿）</label>
                    </div>
                    <div class="input-field col s12 m12 l6">
                        <input id="max_scale" name="max_scale" type="number" class="validate" value="50" step="1">
                        <label for="max_scale">基金规模最大值（亿）</label>
                    </div>
                </div>
                <div class="row">
                    <div class="input-field col s12 m12 l4">
                        <input id="min_estab_years" name="min_estab_years" type="number" class="validate" value="5" step="1">
                        <label for="min_estab_years">该基金成立最低年限</label>
                    </div>
                    <div class="input-field col s12 m12 l4">
                        <input id="min_manager_years" name="min_manager_years" type="number" class="validate" value="5" step="1">
                        <label for="min_manager_years">基金经理管理该基金最低年限</label>
                    </div>
                    <div class="input-field col s12 m12 l4">
                        <select multiple id="types" name="types">
                            {{ range $type := .FundTypes }}
                            <option value="{{ $type }}">{{ $type }}</option>
                            {{ end }}
                        </select>
                        <label for="types">指定基金类型</label>
                    </div>
                </div>
                <div class="row">
                    <div class="input-field col s12 m12 l4">
                        <input id="max_135_avg_stddev" name="max_135_avg_stddev" type="number" class="validate" value="25.0" step="1.0">
                        <label for="max_135_avg_stddev">近1,3,5年波动率平均值的最大值(%)</label>
                    </div>
                    <div class="input-field col s12 m12 l4">
                        <input id="min_135_avg_sharp" name="min_135_avg_sharp" type="number" class="validate" value="1.0" step="1.0">
                        <label for="min_135_avg_sharp">近1,3,5年夏普比率平均值的最小值(%)</label>
                    </div>
                    <div class="input-field col s12 m12 l4">
                        <input id="max_135_avg_retr" name="max_135_avg_retr" type="number" class="validate" value="25.0" step="1.0">
                        <label for="max_135_avg_retr">近1,3,5年最大回撤率平均值的最大值(%)</label>
                    </div>
                </div>
                <div class="row">
                    <button type="submit" class="btn waves-effect waves-light red lighten-2 col s12">筛选</button>
                </div>
            </form>
        </div>
    </div>
    <!--filter end-->

    <!--基金检测 start-->
    <div id="fundcheck" class="col s12">
        <div class="row">
            <form class="col s12" id="fundcheck_form">
                <div class="row">
                    <div class="input-field col s12">
                        <input id="fundcode" name="fundcode" type="text" class="validate" required>
                        <label for="fundcode">输入基金代码</label>
                    </div>
                </div>
                <div class="row">
                    <div class="input-field col s12 m12 l6">
                        <input id="year_1_rank_ratio" name="year_1_rank_ratio" value="25.00" type="number" step="any" class="validate">
                        <label for="year_1_rank_ratio">近1年绩效排名前百分之:</label>
                    </div>
                    <div class="input-field col s12 m12 l6">
                        <input id="this_year_235_rank_ratio" name="this_year_235_rank_ratio" type="number" class="validate" value="25.00" step="any">
                        <label for="this_year_235_rank_ratio">近2,3,5年及今年来绩效排名前百分之:</label>
                    </div>
                </div>
                <div class="row">
                    <div class="input-field col s12 m12 l6">
                        <input id="month_6_rank_ratio" name="month_6_rank_ratio" type="number" class="validate" value="33.33" step="any">
                        <label for="month_6_rank_ratio">近6个月绩效排名前百分之:</label>
                    </div>
                    <div class="input-field col s12 m12 l6">
                        <input id="month_3_rank_ratio" name="month_3_rank_ratio" type="number" class="validate" value="33.33" step="any">
                        <label for="month_3_rank_ratio">近3个月绩效排名前百分之:</label>
                    </div>
                </div>
                <div class="row">
                    <div class="input-field col s12 m12 l6">
                        <input id="min_scale" name="min_scale" type="number" class="validate" value="2" step="1">
                        <label for="min_scale">基金规模最小值（亿）</label>
                    </div>
                    <div class="input-field col s12 m12 l6">
                        <input id="max_scale" name="max_scale" type="number" class="validate" value="50" step="1">
                        <label for="max_scale">基金规模最大值（亿）</label>
                    </div>
                </div>
                <div class="row">
                    <div class="input-field col s12 m12 l6">
                        <input id="min_estab_years" name="min_estab_years" type="number" class="validate" value="5" step="1">
                        <label for="min_estab_years">该基金成立最低年限</label>
                    </div>
                    <div class="input-field col s12 m12 l6">
                        <input id="min_manager_years" name="min_manager_years" type="number" class="validate" value="5" step="1">
                        <label for="min_manager_years">基金经理管理该基金最低年限</label>
                    </div>
                </div>
                <div class="row">
                    <div class="input-field col s12 m12 l4">
                        <input id="max_135_avg_stddev" name="max_135_avg_stddev" type="number" class="validate" value="25.0" step="1.0">
                        <label for="max_135_avg_stddev">近1,3,5年波动率平均值的最大值(%)</label>
                    </div>
                    <div class="input-field col s12 m12 l4">
                        <input id="min_135_avg_sharp" name="min_135_avg_sharp" type="number" class="validate" value="1.0" step="1.0">
                        <label for="min_135_avg_sharp">近1,3,5年夏普比率平均值的最小值(%)</label>
                    </div>
                    <div class="input-field col s12 m12 l4">
                        <input id="max_135_avg_retr" name="max_135_avg_retr" type="number" class="validate" value="25.0" step="1.0">
                        <label for="max_135_avg_retr">近1,3,5年最大回撤率平均值的最大值(%)</label>
                    </div>
                </div>
                <div class="row">
                    <label class="col l2 s12">
                        <input id="check_stocks" name="check_stocks" type="checkbox" class="filled-in" value="true" />
                        <span>检测持仓个股</span>
                    </label>
                </div>

                <div id="checker_options" class="hide collection with-header collapsible">
                    <div class="collection-header">检测指标</div>
                    <div class="collection-item">
                        {{ template "checker_form_content" . }}
                    </div>
                </div>
                <div class="row">
                    <a class="btn waves-effect waves-light red lighten-2 col s12" id="check_fund_submit_btn" >检测</a>
                </div>
            </form>
        </div>
    </div>
    <!-- 基金检测 end -->

    <!-- 持仓相似度 start -->
    <div id="fundsim" class="col s12">
        <div class="row">
            <form class="col s12" id="fundsim_form" action="/fund/similarity" method="GET">
                <div class="row">
                    <div class="input-field col s12">
                        <textarea id="codes" name="codes" class="materialize-textarea validate" required></textarea>
                        <label for="codes">输入需要比较的基金代码</label>
                    </div>
                </div>
                <div class="row">
                    <button type="submit" class="btn waves-effect waves-light red lighten-2 col s12">检测</button>
                </div>
            </form>
        </div>
    </div>
    <!-- 持仓相似度 end -->

    <!-- 股票选基 start -->
    <div id="querybystock" class="col s12">
        <div class="row">
            <form class="col s12" id="fundsim_form" action="/fund/query_by_stock" method="POST">
                <div class="row">
                    <div class="input-field col s12">
                        <textarea id="keywords" name="keywords" class="materialize-textarea validate" required></textarea>
                        <label for="keywords">输入持仓股票名称或代码</label>
                    </div>
                </div>
                <div class="row">
                    <button type="submit" class="btn waves-effect waves-light red lighten-2 col s12">查询</button>
                </div>
            </form>
        </div>
    </div>
    <!-- 股票选基 end -->
</div>

<div id="fund_check_results" class="hide">
</div>
{{ template "modal" . }}
{{ template "footer" . }}
